<template>
  <!-- 访客记录-详情 -->
  <public-modal
    width="900px"
    :footer="false"
    title="营业执照详情"
    modalStyle="detailModal"
    :publicVisible="publicVisible"
    @handleOk="handleOk"
    @cancel="cancel"
  >
    <div slot="content">
      <div class="content-wrapper">
        <div>
          <div class="info-wrap">
            <div class="label common-lable">统一社会信用代码</div>
            <a-tooltip placement="topLeft">
              <template slot="title">
                <span>{{ result.creditCode || '暂无' }} </span>
              </template>
              <div class="value common-value">{{ result.creditCode || '暂无' }}</div>
            </a-tooltip>
          </div>
          <!-- <div class="info-wrap f1">
            <div class="label common-lable">营业执照</div>
            <div class="value common-value click-color cursor" @click="werImg('minImg')">
              点击查看营业执照
              <img
                id="minImg"
                :src="`${imgPrefix + result.businessLicenseUrl}`"
                :data-original="`${imgPrefix + result.businessLicenseUrl}`"
              />
            </div>
          </div> -->
          <div class="">
            <div class="info-img-wrap">
              <div class="label common-lable">证书照片</div>
              <div class="value common-value">
                <img
                  id="idimg"
                  class="cursor cusImg"
                  :src="`${imgPrefix}${result.businessLicenseUrl}`"
                  :data-original="`${imgPrefix}${result.businessLicenseUrl}`"
                  @click="werImg"
                />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div slot="footer"></div>
  </public-modal>
</template>
<script>
import Viewer from 'viewerjs'
import 'viewerjs/dist/viewer.css'
import { getAction } from '@/api/manage'
import { comMethods } from '@/mixins/comMethods'
import publicModal from '@/components/publicModal'
export default {
  name: 'cancelModel',
  components: { publicModal },
  mixins: [comMethods],
  data() {
    return {
      result: {},
      imgPrefix: '',
      publicVisible: false,
    }
  },
  mounted() {},
  methods: {
    async show(id) {
      let { result } = await getAction('/company/message/business_detail', { companyId: id })
      this.result = result
      console.log(result, 'res')
      this.publicVisible = true
    },

    werImg() {
      let id = 'idimg'
      const ViewerDom = document.getElementById(id)
      const viewer = new Viewer(ViewerDom, {
        toolbar: false,
        button: false,
        navbar: false,
        title: false,
        zIndex: '9999',
        url: 'data-original',
      })
    },

    handleOk() {
      this.publicVisible = false
    },
    cancel() {
      this.publicVisible = false
    },
  },
}
</script>
<style lang="less" scoped>
.info-img-wrap {
  height: 480px;
  display: flex;
  align-items: center;

  img {
    width: 600px;
    height: 450px;
    object-fit: contain;
    // object-fit: scale-down;
  }

  .label {
    height: 480px;
    line-height: 480px;
    text-align: center;
  }
  .value {
    height: 480px;
    line-height: 480px;
    text-align: center;
  }
}
</style>
